#include "cstdio"
#include <cstring>

int main(){
    int n,k;
    scanf("%d%d",&n,&k);
    for(int i=n;i>n-k;i--)
        printf("%d ",i);
    for(int i=1;i<=n-k;i--)
        printf("%d ",i);
}